package com.yeung.exam;

import java.util.Arrays;
import java.util.Scanner;

public class 数组查找 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int ind = 0;
        int data[] = new int[count];
        while (ind < count)
            data[ind++] = sc.nextInt();
        //
        Arrays.sort(data);
        boolean isF = true;
        for (int i = 0; i < data.length - 1; i++) {
            int now = data[i];
            if (now > 0) {
                if (isF) {
                    if (now != 1) {
                        System.out.println(1);
                        break;
                    }
                    isF = false;
                } else {
                    if (now + 1 != data[i + 1]) {
                        System.out.println(now + 1);
                        break;
                    }
                }

            }
        }

        for (int datum : data) {
            System.out.println(datum);
        }

    }
}
